class emiconfig::wncondor (
  $resource_group = "none",
  )

  {
  yumrepo { "condor":
    baseurl => "http://${mirrorserver}/yum/condor/9.0/el${operatingsystemmajrelease}/release",
    descr => "condor",
    enabled => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site'],
  }



   $condor_pkg = [
      "condor",
      "condor-classads",
      "condor-kbdd",
      "condor-procd",
      "condor-python",
     ]

  package { $condor_pkg:
    ensure  => installed,
    require => Yumrepo['site'],
  } ->

  file {"/etc/condor/config.d/01-startd.conf":
    mode       =>  '0644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/01-startd.conf",
    notify   => Exec['reconfig_condor']
  } ->

  file {"/etc/condor/config.d/02-startd-hard.conf":
    mode       =>  '0644',
    owner      =>  'root',
    group      =>  'root',
    content    =>  template("${module_name}/02-startd-hard.erb"),
    #notify    => Exec['restart_condor']
    #notify     => Exec['reconfig_condor']
  } ->

  file { "/scratch/condor":
    ensure     =>  "directory",
    owner      =>  'condor',
    group      =>  'condor',
    mode       =>  '755'
  } ->

  service { 'condor':
    ensure     => 'running',
    enable     => true,
    hasrestart => true,
    hasstatus  => true,
  } 

  exec {'restart_condor':
    command      => "/sbin/service condor restart",
    refreshonly  => true,
    require => Package["condor"],
  }

  exec {'reconfig_condor':
    command      => "/usr/sbin/condor_reconfig",
    refreshonly  => true,
    require => Package["condor"],
  }
  
}
